package client

import (
	"encoding/json"
	"tio-proxy-agent/core"
	"tio-proxy-agent/log"
)

type GioClientListener struct{}

func (GioClientListener) OnAfterConnected(ctx *core.ChannelContext) {
	var csp = map[string]string{
		"token": TunnelInfo.Token,
		"host":  TunnelInfo.Domain,
		"bsId":  ctx.Id,
	}
	cspBytes, _ := json.Marshal(csp)

	packet := &BsPacket{
		Type: 5,
		Body: cspBytes,
	}
	ctx.SendData <- packet

}

type GioClientForwardListener struct{}

func (GioClientForwardListener) OnAfterConnected(ctx *core.ChannelContext) {
	log.SugarLogger.Info("和目标服务器连接成功~~")
}
